package com.yc.common.core.domain.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import java.util.Set;

@Data
@AllArgsConstructor
public class UserInfo implements Serializable {

    private static final long serialVersionUID = -5643735529703557240L;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 昵称
     */
    private String nickName;

    /**
     * 头像
     */
    private String avatar;

    /**
     * 性别
     */
    private String sex;

    /**
     * 登录时间
     */
    private LocalDateTime loginTime;

    /**
     * 角色组
     **/
    private List<String> roles;

    /**
     * 权限组
     **/
    private Map<String, Set<String>> permissions;

    public UserInfo() {
        //设置用户登录时间
        this.loginTime = LocalDateTime.now();
    }
}
